home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0199.ZIP / JUNIOR16.PAS < prev    next >
Pascal/Delphi Source File  |  1986-02-08  |  3KB  |  70 lines

  1.  
  2.  
  3.                  (* ********************************************* *)
  4.                  (*                                               *)
  5.                  (*   Many don't realize that you can use the     *)
  6.                  (*   PCjr 160 x 200 Low Resolution 16 Color      *)
  7.                  (*   mode from within Turbo Pascal. The short    *)
  8.                  (*   procedure SetPCjr16Color actuates this      *)
  9.                  (*   screen mode. Write and writeln work but     *)
  10.                  (*   there is no string length checking. You     *)
  11.                  (*   have text coordinates of 1..20,1..25. The   *)
  12.                  (*   gotoxy statement will work. Plot and Draw   *)
  13.                  (*   will also work, but there's a trick to get  *)
  14.                  (*   them to work. You have to call a graphics   *)
  15.                  (*   mode BEFORE you call SetPCjr16Color. I use  *)
  16.                  (*   GraphMode. The call to a graphics mode      *)
  17.                  (*   initializes the plot and draw routines by   *)
  18.                  (*   (apparently) passing them some necessary    *)
  19.                  (*   parameters.                                 *)
  20.                  (*                Donald L. Pavia                *)
  21.                  (*                Department of Chemistry        *)
  22.                  (*                Western Washington University  *)
  23.                  (*                Bellingham, WA   98225         *)
  24.                  (*                                               *)
  25.                  (*                              January 1986     *)
  26.                  (* ********************************************* *)
  27.  
  28.      program Junior16Color;
  29.  
  30.      var  i,j,k,c : integer; Wait : char;
  31.  
  32.      {----------------------------------------------------------------------}
  33.      procedure SetPCjr16col;        { sets PCjr to 160x200 lo res 16 colors }
  34.  
  35.      type   RegRec = record AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : integer; end;
  36.  
  37.      var    Regs : RegRec;
  38.  
  39.      begin  Regs.AX := $0008;  intr($10,Regs)     end;
  40.      {----------------------------------------------------------------------}
  41.                                               { You must call graphmode to  }
  42.      BEGIN                                    { initialize turbo's plot and }
  43.                                               { draw routines. Without this }
  44.           Clrscr; GraphMode; SetPCjr16Col;    { call they will not work.    }
  45.  
  46.           draw (0,0,159,0,2);
  47.           TextColor (14); gotoxy (2,2); write ('HELLO');
  48.           TextColor  (2); gotoxy (7,3); write ('THERE');
  49.  
  50.           j := 36;
  51.           for i := 10 to 50 do begin
  52.              plot (i,j,i mod 16); draw (i+2,j,i+90,j,i mod 16);
  53.              j := j+2;  end;
  54.  
  55.           TextColor (14); gotoxy (1,17);
  56.           write ('This is a PCjr !!!!'); gotoxy (1,19);
  57.  
  58.           for i := 1 to 20 do begin
  59.                    k := i mod 16; if k = 0 then k := 7; c := 64 + i;
  60.                    TextColor (k); write (chr(c)); end;
  61.  
  62.           gotoxy (1,21);
  63.           for i := 1 to 20 do begin
  64.                    K := i mod 16; if k = 0 then k := 7; c := 96 + i;
  65.                    TextColor (k); write (chr(c)); end;
  66.  
  67.           draw (0,199,159,199,2); gotoxy (1,23);
  68.           read (Kbd,Wait); TextMode (c80);
  69.  
  70.      END.